package com.gtw.iterator;

import java.util.Iterator;
import java.util.Vector;

public class ConcreteAggregate implements Aggregate {

    //声明一个存贮元素的容器
    private Vector vector = new Vector();

    public void add(Object obj) {
        this.vector.add(obj);
    }

    public void remove(Object obj) {
        this.vector.remove(obj);
    }

    public Iterator iterator() {
        return new ConcreteIterator(this.vector);
    }
}
